<?php

function div_bar_graph($width,$height,$percentage)
{
	if( $percentage > 1 )
		$percentage = $percentage / 100;
	
	$str  = sprintf('<div style="height:%dpx;width:%dpx;border:1px solid black">', $height, $width);
	$str .= sprintf('<div style="height:%dpx;width:%dpx;background-color:red;"></div>', $height, $width * $percentage);
	$str .= "</div>\n";
	return $str;
}
